//
//  UserInfoModel.m
//  AccountSys
//
//  Created by guoshiqing on 2018/5/24.
//

#import "UserInfoModel.h"

#define KTeamId @"KTeamId"
#define KTeamName @"KTeamName"
#define KTeamRole @"KTeamRole"


@implementation TeamShortInfo
@end

@implementation TeamFullInfo

- (instancetype)initWithShortInfo:(TeamShortInfo *)shortInfo
{
    if (self = [super init]) {
        self.iTeamId = shortInfo.iTeamId;
        self.sTeamName = shortInfo.sTeamName;
        self.iRole = shortInfo.iRole;
    }
    return self;
}
- (instancetype)initWithFullInfo:(TeamFullInfo *)fullInfo
{
    if (self = [super init]) {
        self.iTeamId = fullInfo.iTeamId;
        self.sTeamName = fullInfo.sTeamName;
        self.iRole = fullInfo.iRole;
    }
    return self;
}

- (void)encodeWithCoder:(NSCoder *)aCoder{
    [aCoder encodeObject:_iTeamId forKey:KTeamId];
    [aCoder encodeObject:_sTeamName forKey:KTeamName];
    [aCoder encodeInteger:_iRole forKey:KTeamRole];
}

- (instancetype)initWithCoder:(NSCoder *)aDecoder{
    if (self = [super init]) {
        _iTeamId = [aDecoder decodeObjectForKey:KTeamId];
        _sTeamName = [aDecoder decodeObjectForKey:KTeamName];
        _iRole = [aDecoder decodeIntegerForKey:KTeamRole];
    }
    return self;
}

@end

@implementation UserInfoModel

+ (NSDictionary *)mj_objectClassInArray
{
    return @{@"team":[TeamShortInfo class]};
}

+ (NSDictionary *)replacedKeyFromPropertyName {
    return @{
             @"sAccount": @"sAccount",
             @"isAllowModifyAccount":@"accountModify",
             @"iZoneNum": @"iZoneNum",
             @"sPhone": @"sPhone",
             };
}

@end


